package bold.storage.util;

import java.io.Serializable;
import java.util.concurrent.atomic.LongAdder;

public class IDCopy implements Serializable {
    private static final long serialVersionUID = -7720584186516351072L;
    private static LongAdder longAdder;
    public static IDCopy instance;

    private IDCopy() {
    }

    static {
        instance = new IDCopy();
        longAdder = new LongAdder();
    }

    public String get() {
        if (longAdder.longValue() >= 999) {
            try {
                Thread.sleep(1L);
            } catch (InterruptedException var3) {
                var3.printStackTrace();
            }
            longAdder.reset();
        }
        longAdder.add(1);
        return System.currentTimeMillis() + String.format("%03d", longAdder.sum());
    }
}

